import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

//引入buefy
import Buefy from "buefy";
import 'buefy/dist/buefy.css'

//引入elementui
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

//引入axios
import axios from 'axios'
import VueAxios from 'vue-axios'

//引入全局样式
import '@/assets/app.css'

import '@/permission'

import  relativeTime from 'dayjs/plugin/relativeTime';
//国际化
import 'dayjs/locale/zh-cn'

import './assets/plugins/font-awesome-4.7.0/css/font-awesome.min.css'

import format from 'date-fns/format'


//定义全局时间过滤器函数
Vue.filter('date', (date) => {
  return format(new Date(date), 'yyyy-MM-dd')
})


const  dayjs = require('dayjs')



//相对时间插件
dayjs.extend(relativeTime)

dayjs.locale('zh-cn') // use locale globally
dayjs().locale('zh-cn').format() // use locale in a specific instance

Vue.prototype.dayjs = dayjs;//可以全局使用dayjs

Vue.use(VueAxios, axios)

Vue.use(Buefy);
Vue.use(ElementUI);

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
